home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MIDICraft's MIDINET CD-ROM
/
MIDICraft's MIDINET CD-ROM.iso
/
DOSUTILS
/
ZIPSHORT.DOC
< prev
next >
Wrap
Text File
|
1996-09-22
|
9KB
|
216 lines
******************************
ZIPSHORT v1.0
modify ZIP archive containing
non-dos compatible filenames
by Guenter Nagler
1995
(gnagler@ihm.tu-graz.ac.at)
******************************
[1] BACKGROUND
PKZIP is a popular archive shareware utility developed by PKWARE Inc. (TM)
Now there are compatible tools available on several platforms.
The differences between the file systems are the reasons that some
zipped archives are not easily to unzip when exchanging between certain
systems.
Macintosh, Win95, WinNT system allow using long filenames containing
whitespaces, :, \, and many other characters that are not allowed
in filenames of other file systems (e.g. DOS).
PKUNZIP for DOS does not handle this problem. It tries to write the filenames
and if this works for unbelievable reason, the files are usually not
accessible or simply truncated to 8 characters.
Therefore I wrote this utility ZIPSHORT that parses the ARCHIVE
headers and index and generates DOS compatible short filenames.
It also saves an index that contains the long filenames together with the
generated short names. ZIPSHORT modifies the zip file, but generates
an undo file to be able to undo all modifications at later time using
undo option.
With further options the list of existing short filenames can be extended
(from directory tree or from a list stored in a file). The program
will try to use only short names that are not existing.
The names modified using following methods:
- truncate extensions to maximum 3 characters
- remove all not compatible characters (e.g. spaces)
- remove vowels (a,e,i,o,u) beginning at end of names until name has
maximum 8 characters or all vowels are removed.
- remove not alphanumerical characters beginning at end of names until name
has maximum 8 characters or all characters are alphanumeric.
- truncate name to maximum of 8 characters
- (*) the name is used as is if it is unique to the list of already known short
names
- add iteration number 1, 2, ... to the name until the name is
unique to list of already known short names
- if adding the number will generate a name longer than 8 characters
the name is truncated by a character from end of the name
continue with (*) until a name is accepted
[2] FILES DESCRIPTION
ZIPSHORT.EXE..........MSDOS executable
ZIPSHORT.DOC..........this file, showing usage of ZIPSHORT.EXE
only ZIPSHORT.EXE is required to run program
[3] COPYRIGHT
ZIPSHORT (c) 1996 was created by Guenter Nagler.
ZIPSHORT is free and may be used as you wish with this one exception:
You may NOT charge any fee or derive any profit for distribution
of ZIPSHORT. Thus, you may NOT sell or bundle ZIPSHORT with any
product in a retail environment (shareware disk distribution, CD-ROM,
etc.) without permission of the author.
You may give ZIPSHORT to your friends, upload it to a BBS, or ftp it to
another internet site, as long as you don't charge anything for it.
[4] DISCLAIMER
ZIPSHORT modifies or copies zipped archives when specifying a new filename.
At beginning you should use the safer variant of ZIPSHORT that first
generates a copy of the archive and modifies only the duplicate or
keep a backup of your zip file before using it.
Modifications to zip files usually can be undone by using -u option.
This only works if the zip files are not modified by ZIP tools after
using ZIPSHORT. It is not guaranteed that ZIPSHORT can handle any
zipped archive.
Use ZIPSHORT at your own risk. Anything you do with ZIPSHORT is your
responsibility, and not the author's. Any damage caused to any person,
computer, software, hardware, company, or business by running ZIPSHORT
is your responsibility, and the author will not be liable.
If you don't understand these terms, or are not sure of something, or
are afraid something bad might come of using ZIPSHORT, don't use it!
You are here forewarned.
[5] INSTALLATION
Simply copy ZIPSHORT.EXE in a directory that is in your path.
[6] USAGE
usage: zipshort [-d dir] [-f file] [-u] filename.zip [output.zip]
-d directory all filenames existing in this directory tree are not nused
-f file.lst all filenames in this file are not used (one filename per line)
-u file.und undo changes
The parts in brackets [...] are optional.
Options -d and -f can be used more than once.
The filename.zip must be specified and should refer to an existing zipped
file.
If output.zip parameter is ommitted the filename.zip will be modified
if necessary.
An existing output.zip will be overwritten without warning!
When using the undo -u option ZIPSHORT only undo's recent modifications
to filename.zip done by ZIPSHORT. The name output.zip is ignored by this
option. The file filename.zip and filename.und must exist for this procedure.
When not specifying output.zip parameter, ZIPSHORT modifies filename.zip,
generates index text file filename.lst and a binary undo file filename.und
When using output.zip parameter, ZIPSHORT copies filename.zip to output.zip
modifies output.zip and generates files output.lst and output.und
Options -d and -f are used to exclude a list of (short) filenames
from being used (forces to rename a file if it has such a name).
[7] EXAMPLE
command> zipshort
usage: zipshort [-d dir] [-f file] [-u] filename.zip [output.zip]
-d directory all filenames existing in this directory tree are not nused
-f file.lst all filenames in this file are not used (one filename per line)
-u file.und undo changes
You get the usage text when starting zipshort without parameters.
command> zipshort longname.zip
The file longname.zip will be modified if it contains zipped
files having non-dos compatible filenames.
The files longname.lst and longname.und will be created.
command> zipshort -u longname.zip
The program looks for longname.und and will undo modifications of
longname.zip . The file longname.zip now is exactly as before using
zipshort
command> zipshort longname.zip shortnam.zip
The program saves the modified zipfile to file shortnam.zip
The files shortnam.und and shortnam.lst are generated if modifications
are necessary.
The listing file will look like:
whnthsnt.mid When The Saints Go Marching In.mid
thtswhtf.mid That's What Friends Are For.mid
mrnnghsb.mid Morning Has Broken.mid
lrdflrds.mid Lord of Lords.mid
jshfghtt.mid Joshua Fought The Battle of Jerhico.mid
jesslvsm.mid Jesus Loves Me.mid
jsslvsmn.mid Jesus Loves Me in bluegrass format.mid
grtsthlr.mid Great is the Lord1.mid
elshadd1.mid El Shaddai1.mid
After using ZIPSHORT you will usually use PKUNZIP or a similiar program
to extract the files from the archive:
command> pkunzip longname.zip
Searching ZIP: LONGNAME.ZIP
Inflating: whnthsnt.mid
Inflating: thtswhtf.mid
Inflating: mrnnghsb.mid
Inflating: lrdflrds.mid
Inflating: jshfghtt.mid
Inflating: jesslvsm.mid
Inflating: jsslvsmn.mid
Inflating: grtsthlr.mid
Inflating: elshadd1.mid
See documentation of PKUNZIP for details.
Use the content of longname.lst to remember the original name of an extracted
file.
command> zipshort -d l:\midi longname.zip
directory l:\midi: 3568 filenames excluded
This command will zipshort force to have a look at directory l:\midi
(and its subdirectories). It will get all existing filenames and
tries not to use them when modifying filenames. Instead it will
add a number to make the short filename unique.
command> zipshort -f l:\midi\index.lst longname.zip
directory l:\midi\index.lst: 3553 filenames excluded
ZIPSHORT will read the given textfile index.lst and load all
filenames from this file. These names will not be used when
modifying filenames.
The file listing should look like:
aftersun.mid After the Sunrise (Yanni)
aftrlove.mid After The Love Has Gone (Earth Wind & Fire)
aftrmid.mid After Midnight (?)
agadou.mid Agadou (?)
again.mid Again (Janet Jackson)
againodd.mid Against all odds (Phil Collins)
aganstwd.mid Against the Wind (Bob Seger)
Each line contains a filename at beginning of the line, the rest of the line
is ignored and could contain comment etc.
Options -d and -f can be used together and more than once (e.g. exclude
filenames of different directories).
[8] SUGGESTIONS / COMMENTS / BUG REPORTS
WWW: http://hgiicm.tu-graz.ac.at/Cpub
EMAIL: gnagler@ihm.tu-graz.ac.at